<?php
echo $form;
if(count($contract)){
    echo '<table class="table">';
    echo '<tr>';
        echo '<td>Start Contract:</td>';
        echo '<td>'.substr($contract['StartContract'],0,10).'</td>';
    echo '</tr>';
    echo '<tr>';
        echo '<td>Contract Type:</td>';
        echo '<td>'.$contract['ContractType'].'</td>';
    echo '</tr>';
    if($contract['ContractTypeID']==1){
    echo '<tr>';
        echo '<td>End Contract:</td>';
        echo '<td>'.substr($contract['EndContract'],0,10).'</td>';
    echo '</tr>';
    }
    echo '<tr>';
        echo '<td>Work Type:</td>';
        echo '<td>'.$contract['WorkType'].'</td>';
    echo '</tr>';
    echo '<tr>';
        echo '<td>Position:</td>';
        echo '<td>'.$contract['Title'].'</td>';
    echo '</tr>';
    echo '<tr>';
        echo '<td>Team:</td>';
        echo '<td>'.$contract['TeamName'].'</td>';
    echo '</tr>';
    echo '<tr>';
        echo '<td>Salary:</td>';
        echo '<td>USD '.number_format($contract['Salary'], 2).'</td>';
    echo '</tr>';
    echo '<tr>';
        echo '<td>Phone Allowance:</td>';
        echo '<td>USD '.number_format($contract['PhoneAllowance'], 2).'</td>';
    echo '</tr>';
     echo '<tr>';
        echo '<td>Fuel Allowance:</td>';
        echo '<td>USD '.number_format($contract['FuelAllowance'], 2).'</td>';
    echo '</tr>';
    echo '<tr>';
        echo '<td>Insurance Start:</td>';
        echo '<td>'.substr($contract['InsuranceStart'], 0, 10).'</td>';
    echo '</tr>';
    echo '<tr>';
        echo '<td>Salary Increase:</td>';
        echo '<td>';
            if(count($salaries)){
                foreach($salaries as $key=>$list)
                {
                    echo '<p><strong>'.substr($list['IncreasedDate'], 0, 10).'</strong>&nbsp;&nbsp;Comment: '.$list['Comment'].'</p>';
                }
            }
        echo '</td>';
    echo '</tr>';
     echo '<tr>';
        echo '<td>Yearly Appraisal:</td>';
        echo '<td>';
            if(count($appraisals)){
                foreach($appraisals as $key=>$list)
                {
                    echo '<p><strong>'.substr($list['AppraisalDate'], 0, 10).'</strong>&nbsp;&nbsp;Comment: '.$list['Comment'].'</p>';
                }
            }
        echo '</td>';
    echo '</tr>';
     echo '<tr>';
        echo '<td>Amendment:</td>';
        echo '<td>';
            if(count($amendments)){
                foreach($amendments as $key=>$list)
                {
                    echo '<p><strong>'.substr($list['AmendmentDate'], 0, 10).'</strong>&nbsp;&nbsp;Comment: '.$list['Comment'].'</p>';
                }
            }
        echo '</td>';
    echo '</tr>';
    echo '<tr>';
        echo '<td>Remark:</td>';
        echo '<td>'.$contract['Remark'].'</td>';
    echo '<tr>';
        echo '<td>Activate:</td>';
        echo '<td>';
        echo $contract['SCActive'] == 1? 'Active':'Inactive';
        echo '</td>';
    echo '</tr>';
    echo '</table>';
}
?>